<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('淘客设置')" />
</head>
<body class="white-bg">

    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <div class="tabs-container">
            <ul class="nav nav-tabs" id="config-title">
                <li class="active"><a data-toggle="tab" href="#normal" aria-expanded="true">常规设置</a>
                </li>
                <li class=""><a data-toggle="tab" href="#page" aria-expanded="false">页面设置</a>
                </li>
                <li class=""><a data-toggle="tab" href="#seo" aria-expanded="false">SEO设置</a>
                </li>
                <li class=""><a data-toggle="tab" href="#shop" aria-expanded="false">商品设置</a>
                </li>
                <li class=""><a data-toggle="tab" href="#call-me" aria-expanded="false">联系设置</a>
                </li>
            </ul>
            <div class="tab-content">
                <div id="normal" class="tab-pane active">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-normal" >
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">网站标题：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.title" th:value="${taokeConfig['oly.tao.title']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">网站主页：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.index" th:value="${taokeConfig['oly.tao.index']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">LOGO：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.logo" th:value="${taokeConfig['oly.tao.logo']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">ICO：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.ico" th:value="${taokeConfig['oly.tao.ico']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">页脚设置：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.footer" th:value="${taokeConfig['oly.tao.footer']}" class="form-control" type="text" >
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- 页面设置 -->
                <div id="page" class="tab-pane">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-page" >
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">首页：</label>
                                <div class="col-sm-8">
                                    <input name="oly.web.pageIndex" th:value="${taokeConfig['oly.tao.pageIndex']}" class="form-control" type="number" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">搜索页：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.shop" th:value="${taokeConfig['oly.tao.shop']}" class="form-control" type="number" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">福利页：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.weal" th:value="${taokeConfig['oly.tao.weal']}" class="form-control" type="number" >
                                </div>
                            </div> 
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">教程页：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.course" th:value="${taokeConfig['oly.tao.course']}" class="form-control" type="number" >
                                </div>
                            </div> 
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">排行榜：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.pageRank" th:value="${taokeConfig['oly.tao.pageRank']}" class="form-control" type="number" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">导航页：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.pageLinks" th:value="${taokeConfig['oly.tao.pageLinks']}" class="form-control" type="number" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">关于我本站：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.pageAbout" th:value="${taokeConfig['oly.tao.pageAbout']}" class="form-control" type="number" >
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div id="seo" class="tab-pane">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-seo">
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">作者：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.author" th:value="${taokeConfig['oly.tao.author']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">版权：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.copyright" th:value="${taokeConfig['oly.tao.copyright']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">关键词：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.keywords" th:value="${taokeConfig['oly.tao.keywords']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">描述：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.description" th:value="${taokeConfig['oly.tao.description']}" class="form-control" type="text" >
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- 商品设置 -->
                <div id="shop" class="tab-pane">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-shop" >
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">商品默认状态：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.defaultFettle" th:value="${taokeConfig['oly.tao.defaultFettle']}" class="form-control" type="number" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">商品文章类型：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.postType" th:value="${taokeConfig['oly.tao.postType']}" class="form-control" type="number" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">商品福利类型：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.postWealType" th:value="${taokeConfig['oly.tao.postWealType']}" class="form-control" type="number" >
                                </div>
                            </div>
                        </form>
                    </div>
                </div>

                <div id="call-me" class="tab-pane">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-call-me" >
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">电话：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.contact.phone" th:value="${taokeConfig['oly.tao.contact.phone']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">邮件：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.contact.mail" th:value="${taokeConfig['oly.tao.contact.mail']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">内容：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.content" th:value="${taokeConfig['oly.tao.content']}" class="form-control" type="text" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label is-">地址：</label>
                                <div class="col-sm-8">
                                    <input name="oly.tao.contact.location" th:value="${taokeConfig['oly.tao.contact.location']}" class="form-control" type="text" >
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
        </div>
        <br>
        <button type="button" class="btn btn-w-m btn-primary center-block" id="submit-btn">修改</button>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/config";
        var myForm="form-normal";
        $('#config-title a').click(function (e) {
            e.preventDefault();
            $(this).tab('show');
            myForm= $(this).attr('href').replace("#","form-");
            console.log(myForm);
        });
        function submitHandler() {
            $.operate.save(prefix + "/updateByKey", $('#'+myForm).serialize());

        }
        $("#submit-btn").click(function (){
            submitHandler();
        })
    </script>
</body>
</html>